home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / SPAWNO41.ARJ / _SPAWNPE.C < prev    next >
C/C++ Source or Header  |  1991-11-01  |  1KB  |  42 lines

  1. /********************************************************************/
  2. /*   SPAWNO v4.0   EMS/XMS/disk swapping replacement for spawn...() */
  3. /*   (c) Copyright 1991 Ralf Brown  All Rights Reserved         */
  4. /*                                    */
  5. /*   May be freely copied provided that this copyright notice is    */
  6. /*   not altered or removed.                        */
  7. /********************************************************************/
  8.  
  9. #include <alloc.h>
  10. #include "_spawno.h"
  11.  
  12. int _Cdecl spawnvpe(int type,const char *prog_name,const char **args,
  13.             const char **env)
  14. {
  15.    if (type != P_WAIT)
  16.       {
  17.       errno = EINVAL ;
  18.       return -1 ;
  19.       }
  20.    return spawnvpeo(___spawn_swap_dirs,prog_name,args,env) ;
  21. }
  22.  
  23. int _Cdecl spawnlpe(int type,const char *prog_name, ...)
  24. {
  25.    int retval ;
  26.    va_list env ;
  27.  
  28.    if (type != P_WAIT)
  29.       {
  30.       errno = EINVAL ;
  31.       return -1 ;
  32.       }
  33.    va_start(env,1) ;
  34.    while (*((char **)env))  /* find NULL terminating list of program args */
  35.       va_arg(env,char *) ;
  36.    va_arg(env,const char **) ; /* point at pointer to list of env variables */
  37.    retval = spawnvpeo(___spawn_swap_dirs,prog_name,(const char **)_va_ptr,
  38.               *((const char ***)env)) ;
  39.    va_end(env) ;
  40.    return retval ;
  41. }
  42.